<?php
	
	header("content-type","text/html;charset=utf-8");
	
	//接收前端传来的数据
	$username = $_POST["username"];
	$password = $_POST["password"];
	
	 // 建立链接
	 $con=mysql_connect("localhost","root","123456");
   
	 //选择数据库
	 mysql_select_db("xiaozi");
	
	//执行SQL语句
	
	$result = mysql_query("insert into user(username,password) values('$username','$password')",$con);
	
	//给前端响应
    if($result==1){
		echo "success";//表示注册成功
	}else{
		echo "erro";//表示注册失败
	}
	//3、关闭数据库
	mysql_close($con);
?>